package cn.thornbird.orgsync.model.dingtalk;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

import java.util.List;

@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class DepartmentDetail extends Response {

    @JsonProperty("result")
    private Department result;

    @Data
    public static class Department {

        @JsonProperty("dept_id")
        private Long deptId;

        @JsonProperty("name")
        private String name;

        @JsonProperty("parent_id")
        private Long parentId;

        @JsonProperty("source_identifier")
        private String sourceIdentifier;

        @JsonProperty("create_dept_group")
        private Boolean createDeptGroup;

        @JsonProperty("auto_add_user")
        private Boolean autoAddUser;

        @JsonProperty("tags")
        private String tags;

        @JsonProperty("from_union_org")
        private Boolean fromUnionOrg;

        @JsonProperty("order")
        private Long order;

        @JsonProperty("dept_group_chat_id")
        private String deptGroupChatId;

        @JsonProperty("group_contain_sub_dept")
        private Boolean groupContainSubDept;

        @JsonProperty("org_dept_owner")
        private String orgDeptOwner;

        @JsonProperty("dept_manager_userid_list")
        private List<String> deptManagerUserIdList;

        @JsonProperty("outer_dept")
        private Boolean outerDept;

        @JsonProperty("outer_permit_depts")
        private List<Long> outerPermitDepts;

        @JsonProperty("outer_permit_users")
        private List<String> outerPermitUsers;

        @JsonProperty("user_permits")
        private List<String> userPermits;

        @JsonProperty("hide_dept")
        private Boolean hideDept;

        @JsonProperty("dept_permits")
        private List<Long> deptPermits;

        @JsonProperty("auto_approve_apply")
        private Boolean autoApproveApply;

        @JsonProperty("code")
        private String code;

        @JsonProperty("union_dept_ext")
        private UnionDeptExt unionDeptExt;

    }


    @Data
    public static class UnionDeptExt {

        @JsonProperty("deptId")
        private Long deptId;

        @JsonProperty("corpId")
        private String corpId;

    }

}
